package cn.kginglam.dynamic_excel.model.excel;

import cn.kginglam.dynamic_excel.common.annotation.NotBlank;
import cn.kginglam.dynamic_excel.common.utils.BitStatesUtils;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;

import java.io.Serializable;
import java.util.List;

/**
 * @author: Lam
 * @date: 2021-09-09 16:29
 * @description:
 */
public class StudentInfoImportModule extends ImportModule implements Serializable {

    private static final long serialVersionUID = -8658151514474374722L;


    @ExcelProperty(value = "学员姓名", index = 0)
    @NotBlank
    private String name;

    @ExcelProperty(value = "证件类型", index = 1)
    @NotBlank
    private String cardNoType;

    @ExcelProperty(value = "证件号码", index = 2)
    @NotBlank
    private String cardNo;

    @ExcelProperty(value = "手机号码", index = 3)
    @NotBlank
    private String phone;

    @ExcelProperty(value = "学生qq", index = 4)
    private String qq;

    @ExcelProperty(value = "学生email", index = 5)
    private String email;

    @ExcelProperty(value = "入学学期", index = 6)
    @NotBlank
    private String termName;

    @ExcelProperty(value = "层次", index = 7)
    @NotBlank
    private String levelName;

    @ExcelProperty(value = "专业", index = 8)
    @NotBlank
    private String majorName;

    @ExcelProperty(value = "学生性别", index = 9)
    @NotBlank
    private String sex;

    @ExcelProperty(value = "业务归属人工号", index = 10)
    @NotBlank
    private String salesmanCode;

    @ExcelProperty(value = "业务归属人姓名", index = 11)
    @NotBlank
    private String salesmanName;


    /**
     * 行号
     */
    @ExcelIgnore
    private Integer currentRowNum;
    /**
     * 层次Id
     */
    @ExcelIgnore
    private Long levelId;
    /**
     * 专业ID
     */
    @ExcelIgnore
    private Long majorId;
    /**
     * 学期ID
     */
    @ExcelIgnore
    private Long termId;
    /**
     * 业务归属人学习中心ID
     */
    @ExcelIgnore
    private Long studyCenterId;
    /**
     * 部门ID
     */
    @ExcelIgnore
    private Long deptId;
    /**
     * 错误信息
     */

    /**
     * 系统学员ID
     */
    @ExcelIgnore
    private Long studentId;
    /**
     * 业务归属人对应院校下所有学习中心
     */
    @ExcelIgnore
    private List<Long> studyCenterIdList;


    @ExcelIgnore
    private String exceptionInfo;
    /**
     * 异常码
     */
    @ExcelIgnore
    private volatile Long exceptionCode = 0L;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCardNoType() {
        return cardNoType;
    }

    public void setCardNoType(String cardNoType) {
        this.cardNoType = cardNoType;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTermName() {
        return termName;
    }

    public void setTermName(String termName) {
        this.termName = termName;
    }

    public String getLevelName() {
        return levelName;
    }

    public void setLevelName(String levelName) {
        this.levelName = levelName;
    }

    public String getMajorName() {
        return majorName;
    }

    public void setMajorName(String majorName) {
        this.majorName = majorName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSalesmanCode() {
        return salesmanCode;
    }

    public void setSalesmanCode(String salesmanCode) {
        this.salesmanCode = salesmanCode;
    }

    public String getSalesmanName() {
        return salesmanName;
    }

    public void setSalesmanName(String salesmanName) {
        this.salesmanName = salesmanName;
    }

    public Integer getCurrentRowNum() {
        return currentRowNum;
    }

    public void setCurrentRowNum(Integer currentRowNum) {
        this.currentRowNum = currentRowNum;
    }

    public Long getLevelId() {
        return levelId;
    }

    public void setLevelId(Long levelId) {
        this.levelId = levelId;
    }

    public Long getMajorId() {
        return majorId;
    }

    public void setMajorId(Long majorId) {
        this.majorId = majorId;
    }

    public Long getTermId() {
        return termId;
    }

    public void setTermId(Long termId) {
        this.termId = termId;
    }

    public Long getStudyCenterId() {
        return studyCenterId;
    }

    public void setStudyCenterId(Long studyCenterId) {
        this.studyCenterId = studyCenterId;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }


    public Long getStudentId() {
        return studentId;
    }

    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    public List<Long> getStudyCenterIdList() {
        return studyCenterIdList;
    }

    public void setStudyCenterIdList(List<Long> studyCenterIdList) {
        this.studyCenterIdList = studyCenterIdList;
    }

    public String getExceptionInfo() {
        return exceptionInfo;
    }

    public void setExceptionInfo(String exceptionInfo) {
        this.exceptionInfo = exceptionInfo;
    }

    public Long getExceptionCode() {
        return exceptionCode;
    }

    public void setExceptionCode(Long exceptionCode) {
        this.exceptionCode = exceptionCode;
    }

    public synchronized void addExceptionCode(Long exceptionCode) {
        Long sourceCode = this.getExceptionCode();
        Long resultCode = BitStatesUtils.addState(sourceCode, exceptionCode);
        this.setExceptionCode(resultCode);
    }
}
